<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        var str = prompt("请输入一组数，用‘ ’分隔");
        var b = str.split(" ");
        var numbles = [];
        for (var i in b)
            numbles[i] = parseInt(b[i]);
        for (var i = 0; i < numbles.length - 1; i++) {
            for (var j = i + 1; j < numbles.length; j++) {
                if (numbles[i] > numbles[j]) {
                    var a;
                    a = numbles[i];
                    numbles[i] = numbles[j]; console.log(numbles[i]);
                    numbles[j] = a;
                }
            }
        }
        for (var i in numbles) {
            document.write(numbles[i] + " ");
        }
    </script>
</head>

<body>

</body>

</html>